package com.zzu.team.service.impl;

import com.zzu.team.dao.ResultDao;
import com.zzu.team.entity.Result;
import com.zzu.team.entity.ResultVo;
import com.zzu.team.entity.Tester;
import com.zzu.team.service.ResultService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("resultService")
public class ResultServiceImpl implements ResultService {

    @Resource
    ResultDao resultDao;

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return resultDao.deleteByPrimaryKey(id);
    }

    @Override
    public int deleteBatchByPrimaryKey(List<Integer> ids) {
        return resultDao.deleteBatchByPrimaryKey(ids);
    }

    @Override
    public int deleteBatchByTesterId(List<Integer> testerIds) {
        return resultDao.deleteBatchByTesterId(testerIds);
    }

    @Override
    public int deleteBatchByQuestionId(List<Integer> questionIds) {
        return resultDao.deleteBatchByQuestionId(questionIds);
    }

    @Override
    public int insert(Result record) {
        return resultDao.insert(record);
    }

    @Override
    public int insertSelective(Result record) {
        return resultDao.insertSelective(record);
    }

    @Override
    public int insertBatch(List<Result> results) {
        return resultDao.insertBatch(results);
    }

    @Override
    public Result selectByPrimaryKey(Integer id) {
        return resultDao.selectByPrimaryKey(id);
    }

    @Override
    public List<Result> selectByTesterId(Integer testerId) {
        return resultDao.selectByTesterId(testerId);
    }

    @Override
    public List<Result> selectByQuestionId(Integer questionId) {
        return resultDao.selectByQuestionId(questionId);
    }

    @Override
    public int updateByPrimaryKeySelective(Result record) {
        return resultDao.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(Result record) {
        return resultDao.updateByPrimaryKey(record);
    }

    @Override
    public List<ResultVo> selectAllTesterResult(Integer page, Integer limit, Tester tester) {
        return resultDao.selectAllTesterResult(page, limit, tester);
    }

    @Override
    public long count(Tester tester) {
        return resultDao.count(tester);
    }
}
